package com.xbts.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xbts.system.mapper.SeiConfigMaterialMapper;
import com.xbts.system.domain.SeiConfigMaterial;
import com.xbts.system.service.ISeiConfigMaterialService;

/**
 * 素材配置Service业务层处理
 * 
 * @author xbts
 * @date 2023-09-07
 */
@Service
public class SeiConfigMaterialServiceImpl  extends ServiceImpl<SeiConfigMaterialMapper, SeiConfigMaterial> implements ISeiConfigMaterialService {

    /**
     * 查询素材配置列表
     *
     * @param seiConfigMaterial 素材配置
     * @return 素材配置
     */
    @Override
    public List<SeiConfigMaterial> selectSeiConfigMaterialList(SeiConfigMaterial seiConfigMaterial) {
        QueryWrapper<SeiConfigMaterial> queryWrapper = seiConfigMaterial.queryWrapper();
        return list(queryWrapper);
    }

    /**
     * 查询素材配置
     *
     * @param materialId 素材配置主键
     * @return 素材配置
     */
    @Override
    public SeiConfigMaterial selectSeiConfigMaterialByMaterialId(String materialId) {
        return getById(materialId);
    }

    /**
     * 新增素材配置
     *
     * @param seiConfigMaterial 素材配置
     * @return 结果
     */
    @Override
    public boolean insertSeiConfigMaterial(SeiConfigMaterial seiConfigMaterial) {
        return save(seiConfigMaterial);
    }

    /**
     * 修改素材配置
     *
     * @param seiConfigMaterial 素材配置
     * @return 结果
     */
    @Override
    public boolean updateSeiConfigMaterial(SeiConfigMaterial seiConfigMaterial) {
        return updateById(seiConfigMaterial);
    }

    /**
     * 批量删除素材配置
     *
     * @param materialIds 需要删除的素材配置主键
     * @return 结果
     */
    @Override
    public boolean deleteSeiConfigMaterialByMaterialIds(List<String> materialIds) {
        return removeBatchByIds(materialIds);
    }

    /**
     * 删除素材配置信息
     *
     * @param materialId 素材配置主键
     * @return 结果
     */
    @Transactional
    @Override
    public boolean deleteSeiConfigMaterialByMaterialId(String materialId) {
      return removeById(materialId);
    }

}
